
cc.Class({
    extends: cc.Component,

    properties: {
     topNode: cc.Node,
     suijipipeiNode: cc.Node,
     kaifangjianNode: cc.Node,
     sousuofangjianNode: cc.Node,
     //testInButton: cc.Button,
     //testOutButton: cc.Button,
    },

    onLoad () {
        this.topNode.y = 300;
        this.suijipipeiNode.x = -590;
        this.sousuofangjianNode.x = 590;
        this.kaifangjianNode.y = -420;
        this.topStartMove();
        this.suijipipeiStartMove();
        this.kaifnagjianStartMove();
        this.sousuofangjianStartMove();

        //this.testInButton.node.on('click',this.testIn,this);
        //this.testOutButton.node.on('click',this.testOut,this);

        cc.vv.mainUIAction = this;
    },

    testIn: function () {
        this.topStartMove();
        this.suijipipeiStartMove();
        this.kaifnagjianStartMove();
        this.sousuofangjianStartMove();
    },

    testOut: function () {
        this.topEndMove();
        this.suijipipeiEndMove();
        this.kaifangjianEndMove();
        this.sousuofangjianEndMove();
    },

    mainUiOut: function () {
        this.topEndMove();
        this.suijipipeiEndMove();
        this.kaifangjianEndMove();
        this.sousuofangjianEndMove();
    },

    mainUiIN: function () {
        this.topStartMove();
        this.suijipipeiStartMove();
        this.kaifnagjianStartMove();
        this.sousuofangjianStartMove();
    },

    xuanzeUIIN: function () {
        this.suijipipeiStartMove();
        this.kaifnagjianStartMove();
        this.sousuofangjianStartMove();
    },

    xuanzeUIOut: function () {
        this.suijipipeiEndMove();
        this.kaifangjianEndMove();
        this.sousuofangjianEndMove();
    },
       


    topStartMove: function () {
        var action = cc.moveTo(0.5, cc.v2(0,238));
        this.topNode.runAction(action);
    },

    topEndMove: function () {
        var action = cc.moveTo(0.5, cc.v2(0,300));
        this.topNode.runAction(action);
    },

    suijipipeiStartMove: function () {
        var action = cc.moveTo(0.5, cc.v2(-280,-40));
        this.suijipipeiNode.runAction(action);
    },

    suijipipeiEndMove: function () {
        var action = cc.moveTo(0.5, cc.v2(-590,-40));
        this.suijipipeiNode.runAction(action);
    },

    kaifnagjianStartMove: function () {
        var action = cc.moveTo(0.5, cc.v2(0,-40));
        this.kaifangjianNode.runAction(action);
    },

    kaifangjianEndMove: function () {
        var action = cc.moveTo(0.5, cc.v2(0,-420));
        this.kaifangjianNode.runAction(action);
    },

    sousuofangjianStartMove: function () {
        var action = cc.moveTo(0.5, cc.v2(280,-40));
        this.sousuofangjianNode.runAction(action);
    },
  
    sousuofangjianEndMove: function () {
        var action = cc.moveTo(0.5, cc.v2(590,-40));
        this.sousuofangjianNode.runAction(action);
    },

    onDestroy: function () {

    }
});
